package com.qbw.app.model;

import androidx.databinding.Bindable;

import java.io.Serializable;

/**
 * @author QBW
 * @date 2019-09-01
 */
public class Travel extends BaseModel implements Serializable {

    private Vehicle vehicle;
    private double driverTime;
    private boolean end;
    private Point endPoint;
    private boolean error;
    private double mile;
    private double score;
    private Point startPoint;
    private String travelCode;
    private int vehicleClass;
    private double avgFuel;
    private double maxSpeed;
    private double avgSpeed;
    private double fuel;
    private String vehicleNick;
    /**
     * 急加速
     */
    private int accelerateTimes;
    /**
     * 急减速次数
     */
    private int decelerateTimes;
    /**
     * 急转弯次数
     */
    private int sharpTurnTimes;
    /**
     * 超速次数
     */
    private int overspeedTimes;

    public Vehicle getVehicle() {
        return vehicle;
    }

    public void setVehicle(Vehicle vehicle) {
        this.vehicle = vehicle;
    }

    public double getDriverTime() {
        return driverTime;
    }

    public void setDriverTime(double driverTime) {
        this.driverTime = driverTime;
    }

    public boolean isEnd() {
        return end;
    }

    public void setEnd(boolean end) {
        this.end = end;
    }

    public Point getEndPoint() {
        return endPoint;
    }

    public void setEndPoint(Point endPoint) {
        this.endPoint = endPoint;
    }

    public boolean isError() {
        return error;
    }

    public void setError(boolean error) {
        this.error = error;
    }

    public double getMile() {
        return mile;
    }

    public void setMile(double mile) {
        this.mile = mile;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public Point getStartPoint() {
        return startPoint;
    }

    public void setStartPoint(Point startPoint) {
        this.startPoint = startPoint;
    }

    public String getTravelCode() {
        return travelCode;
    }

    public void setTravelCode(String travelCode) {
        this.travelCode = travelCode;
    }

    public int getVehicleClass() {
        return vehicleClass;
    }

    public void setVehicleClass(int vehicleClass) {
        this.vehicleClass = vehicleClass;
    }

    public double getAvgFuel() {
        return avgFuel;
    }

    public String getVehicleNick() {
        return vehicleNick;
    }

    public void setVehicleNick(String vehicleNick) {
        this.vehicleNick = vehicleNick;
    }

    public static class Point extends BaseModel implements Serializable {
        /**
         * latitude : 22.58713913
         * longitude : 113.97229767
         * time : 1504458812000
         */

        private double latitude;
        private double longitude;
        private long time;
        private String address;

        public double getLatitude() {
            return latitude;
        }

        public void setLatitude(double latitude) {
            this.latitude = latitude;
        }

        public double getLongitude() {
            return longitude;
        }

        public void setLongitude(double longitude) {
            this.longitude = longitude;
        }

        public long getTime() {
            return time;
        }

        public void setTime(long time) {
            this.time = time;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public boolean isPointValid() {
            return (int) latitude != 0 && (int) longitude != 0;
        }
    }



    public void setAvgFuel(double avgFuel) {
        this.avgFuel = avgFuel;
    }

    public double getMaxSpeed() {
        return maxSpeed;
    }

    public void setMaxSpeed(double maxSpeed) {
        this.maxSpeed = maxSpeed;
    }

    public double getAvgSpeed() {
        return avgSpeed;
    }

    public void setAvgSpeed(double avgSpeed) {
        this.avgSpeed = avgSpeed;
    }

    public double getFuel() {
        return fuel;
    }

    public void setFuel(double fuel) {
        this.fuel = fuel;
    }

    @Bindable
    public int getAccelerateTimes() {
        return accelerateTimes;
    }

    public void setAccelerateTimes(int accelerateTimes) {
        this.accelerateTimes = accelerateTimes;
    }

    @Bindable
    public int getDecelerateTimes() {
        return decelerateTimes;
    }

    public void setDecelerateTimes(int decelerateTimes) {
        this.decelerateTimes = decelerateTimes;
    }

    @Bindable
    public int getSharpTurnTimes() {
        return sharpTurnTimes;
    }

    public void setSharpTurnTimes(int sharpTurnTimes) {
        this.sharpTurnTimes = sharpTurnTimes;
    }

    @Bindable
    public int getOverspeedTimes() {
        return overspeedTimes;
    }

    public void setOverspeedTimes(int overspeedTimes) {
        this.overspeedTimes = overspeedTimes;
    }

    public static class Response extends BaseResponse<Travel> {}

    public static class DataList extends BaseModelList<Travel> {}

    public static class ResponseList extends BaseResponse<DataList> {}

}
